package com.Ajava1704.for并发包下的类.ForSemphor;

import java.util.concurrent.Semaphore;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * 作者: LCG
 * 日期: 2020/2/11 11:17
 * 描述:
 */
public class ForTestSemphor {

    public static void main(String[] args) {

        Semaphore semaphore=new Semaphore(1);

        Thread thread=new Thread(new ForSemphRunable(semaphore,1),"A");
        thread.start();

        Thread thread3=new Thread(new ForSemphRunable(semaphore,2),"B");
        thread3.start();

        Thread thread4=new Thread(new ForSemphRunable(semaphore,3),"C");
        thread4.start();

        Thread thread5=new Thread(new ForSemphRunable(semaphore,2),"D");
        thread5.start();

        Thread thread2=new Thread(new ForSemphRunable(semaphore,1),"E");
        thread2.start();






    }

}
